package com.huidao.ui;

import java.util.Scanner;

import com.huidao.service.RegistService;
import com.huidao.service.UserService;

public class MesOfUserMenu {
	private static final int STOP = 1;
	private static final int ADD = 1;
	private static final int DEL = 2;
	private static final int CHANGE = 3;
	private static Scanner sc = new Scanner(System.in);
	public void operation(){
		System.out.println("--------用户操作管理界面------");
		System.out.println("请输入您要执行的操作：1-->添加用户，2-->删除用户，3-->修改");
		int operation = sc.nextInt();
		switch (operation) {
		case ADD:{
			while(true){
				System.out.println("停止用户界面操作请输入1");
				if (sc.nextInt()==STOP) {
					break;
				}
					new RegistService().regist(1);
					break;
			}
		}
		case DEL:{
			while(true){
				System.out.println("停止用户界面操作请输入1");
				if (sc.nextInt()==STOP) {
					break;
				}
				new UserService().del();
				break;
			}
		}
		case CHANGE:{
			while(true){
				System.out.println("停止用户界面操作请输入1");
				if (sc.nextInt()==STOP) {
					break;
				}
				new UserService().change();
				break;
			}
		}
		default:
			break;
		}
	}

}
